﻿<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../helpproject.xsl" ?>
<topic template="Default" lasteditedby="Geert" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../helpproject.xsd">
  <title translate="true">Converters</title>
  <keywords>
    <keyword translate="true">Converter</keyword>
    <keyword translate="true">Converters</keyword>
    <keyword translate="true">IValueConverter</keyword>
  </keywords>
  <body>
    <header>
      <para styleclass="Heading1"><text styleclass="Heading1" translate="true">Converters</text></para>
    </header>
    <para styleclass="Normal"><text styleclass="Normal" translate="true">In MVVM, there will be some point where you will need to use converters. Most of these converters are used in any project, so we have decided to add them the Catel. Below is a list of converters and a short description what they are used for.</text></para>
    <para styleclass="Notes"><text styleclass="Notes" translate="true">Note that the behavior of most converters can be inverted by using the ConverterParameter</text></para>
    <para styleclass="Normal"><table styleclass="Default" rowcount="21" colcount="3">
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Name</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">Description</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><text styleclass="Normal (list)" style="font-weight:bold;" translate="true">TwoWay</text></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">BooleanToCollapsingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Convert from bool to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" translate="true"> and back.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">BooleanToHidingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Convert from bool to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" translate="true"> and back.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">BooleanToGrayscaleConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a boolean to a grayscale saturation value. If the input is false, this converter will return 0, otherwise 1.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">BooleanToOppositeBooleanConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Convert a boolean to it&apos;s inverted value.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">BooleanToTextConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a boolean value to text, for example &quot;yes&quot; and &quot;no&quot;, or &quot;x&quot; and &quot; &quot;.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ColorToBrushConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a color value to a brush and vice versa.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ContainsItemsConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Convert the count of a collection to true or false, depending on whether the collection contains items.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">EmptyStringToCollapsingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a string to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility.</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true"> If the string is empty, it will return </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Collapsed</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">EmptyStringToHidingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a string to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility.</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true"> If the string is empty, it will return </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Hidden</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">IntToStringConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts integer to string and back.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">IsSelectedConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a selected value to either true of false.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">IsSelectedValueConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a selected value to either true of false.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">MethodToValueConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts the result of a method to a value. This makes it possible to bind to a method.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">MultiplyConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Calculates the product of given value and factor in parameter.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">NullableValueConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a value to a representive value for nullable.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ReferenceToBooleanConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a reference to a boolean. If the reference is </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">null</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">, it will return </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">false</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ReferenceToCollapsingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a reference to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility.</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true"> If the reference is </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">null</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">, it will return </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Collapsed</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ReferenceToHidingVisibilityConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a reference to </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility.</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true"> If the reference is </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">null</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">, it will return </text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Visibility</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text><text styleclass="Normal (list)" style="font-style:italic;" translate="true">Hidden</text><text styleclass="Normal (list)" style="font-style:normal;" translate="true">.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="notsupported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">ShortDateFormattingConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts a date to a short date and back.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
      <tr style="vertical-align:top">
        <td style="width:280px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">StringToIntConverter</text></para>
        </td>
        <td style="width:828px;">
          <para styleclass="Normal (list)"><text styleclass="Normal (list)" translate="true">Converts string to integer and back.</text></para>
        </td>
        <td style="width:99px;">
          <para styleclass="Normal (list)" style="text-align:center;"><image src="supported.png" scale="100.00%" styleclass="Normal (list)"></image></para>
        </td>
      </tr>
    </table></para>
  </body>
</topic>
